<template>
  <div>这是child2组件 - {{ time }} - {{ count }}</div>
</template>

<script>
import { mapGetters, mapState } from "vuex";
export default {
  // computed: {
  // oddList() {
  //   return this.$store.state.list.filter((item) => item % 2);
  // },
  // time() {
  //   const date = new Date(this.$store.state.sjc);
  //   const YY = date.getFullYear() + "-";
  //   const MM =
  //     (date.getMonth() + 1 < 10
  //       ? "0" + (date.getMonth() + 1)
  //       : date.getMonth() + 1) + "-";
  //   const DD = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
  //   const hh =
  //     (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
  //   const mm =
  //     (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) +
  //     ":";
  //   const ss =
  //     date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
  //   return YY + MM + DD + " " + hh + mm + ss;
  // },
  //   time() {
  //     return this.$store.getters.time;
  //   },
  // },

  // computed: mapGetters(["time"]),

  computed: {
    ...mapGetters(["time"]),
    ...mapState(["count"]),
  },
};
</script>
